<?php
/**
 * PageTitle view helper
 *
 * @category    IPB_CMS
 * @package     App_View
 * @subpackage  Helper
 * @copyright   Copyright (c) 2009 IPB CMS <http://ipb-cms.googlecode.com/>
 * @license     http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License
 * @author      Henrique Moody <henriquemoody@gmail.com>
 */
class App_View_Helper_PageTitle extends Zend_View_Helper_Abstract
{

    /**
     * Sets the title of the page
     *
     * @param string $title
     */
    public function pageTitle($title = null)
    {
        $view = $this->view;
        if (!is_null($title)) {
            $title = $view->translate($title);
            $view->headTitle($title, 'PREPEND');
            $view->title = $title;
        }
        return $view->title;
    }

}
